#include <QtCore>
#include <QDialog>
#include <QMainWindow>

#include "ui_mainwindow.h"
#include "lib/config.h"

class ConfigEdit : public QMainWindow
{
  Q_OBJECT
  
public:
  ConfigEdit ();
  virtual ~ConfigEdit();
  
public slots:
  virtual void openConfigFile();
  virtual void showEvent (QShowEvent*);
  virtual void selectRootPath();
  virtual void cancel();
  virtual void apply();
  virtual void killServer();
  

private:
  void loadConfigFrom(QString &fileName);
  void saveConfigIn(QString &fileName);
  void updateForm();
  void updateConfig();
  
  serverconfig serverConfig;
  QString fileName;
  Ui::ConfigWindow ui;
  
};

